//1.首先引入封装http.js文件，调用抛出的http
import {
	http
} from './http.js'

// 接口路径
let url = {
	login: 'api/login',
	getSystemCate: 'api/getSystemCate',
	getSystemBanner: 'api/getSystemBanner',
	getRegionByLatAndLon: 'api/getRegionByLatAndLon',
	getHomeData: 'api/getHomeData',
	getGoodDataBySysCate: 'api/getGoodDataBySysCate',
	getOpenStoreRegion: 'api/getOpenStoreRegion',
	getAddressList: 'api/getAddressList',
	getGoodDetailByCode: 'api/getGoodDetailByCode',
	saveAddress: 'api/saveAddress',
	getCartList: 'api/getCartList',
	delAddress: 'api/delAddress',
	getCenterData: 'api/getCenterData',
	addCart: 'api/addCart',
	getAllCartNumByToken: 'api/getAllCartNumByToken',
	getActGoodsInStore: 'api/getActGoodsInStore',
	getBaseUserInfo: 'api/getBaseUserInfo',
	setUserInfo: 'api/setUserInfo',
	getSearchHistory: 'api/getSearchHistory',
	delSearchHistory: 'api/delSearchHistory',
	getSearchData: 'api/getSearchData',
	getBrowseHistory: 'api/getBrowseHistory',
	delBrowseHistory: 'api/delBrowseHistory',
	serCartNum: 'api/serCartNum',
	delCart: 'api/delCart',
	getOrderByCartId: 'api/getOrderByCartId',
	getSingleAddress: 'api/getSingleAddress',
	setCollect: 'api/setCollect',
	sendSmsCode: 'api/sendSmsCode',
	getCollectList: 'api/getCollectList',
	getCommentList: 'api/getCommentList',
	getOrderList: 'api/getOrderList',
	getExtractRecord: 'api/getExtractRecord',
	applyExtractAmount: 'api/applyExtractAmount',
	getStoreInfoByID: 'api/getStoreInfoByID',
	getGoodsInStoreByMarks: 'api/getGoodsInStoreByMarks',
	placeOrder: 'api/placeOrder',
	getTradeNoToPay: 'api/getTradeNoToPay',
	wxPay: 'api/wxPay',
	getRecommendList: 'api/getRecommendList',
	cancelOrder: 'api/cancelOrder',
	getUserBalance: 'api/getUserBalance',
	getOrderByOrderNumber: 'api/getOrderByOrderNumber',
	confirmReceipt: 'api/confirmReceipt',
	applyAfterSales: 'api/applyAfterSales',
	addComment: 'api/addComment',
	getGoodBySku: 'api/getGoodBySku',
	bank: 'api/bank',
	getBank: 'api/getBank',
	myServiceOrder:'api/myServiceOrder',
	myServiceOrderDetail:'api/myServiceOrderDetail'
}

//抛出数据
module.exports = {
	// 获取售后详情
	myServiceOrderDetail(params) {
		return http({
			url: url.myServiceOrderDetail,
			data: params,
			method:'get'
		})
	},
	// 获取售后列表
	myServiceOrder(params) {
		return http({
			url: url.myServiceOrder,
			data: params,
			method:'get'
		})
	},
	// 获取银行卡
	getBank(params) {
		return http({
			url: url.getBank,
			data: params,
			method:'get'
		})
	},
	// 获设置银行卡
	bank(params) {
		return http({
			url: url.bank,
			data: params,
			method:'post'
		})
	},
	// 获取需要评论的数据
	getGoodBySku(params) {
		return http({
			url: url.getGoodBySku,
			data: params,
			method:'get'
		})
	},
	// 添加评论
	addComment(params) {
		return http({
			url: url.addComment,
			data: params,
			method:'post'
		})
	},
	// 申请售后
	applyAfterSales(params) {
		return http({
			url: url.applyAfterSales,
			data: params,
			method:'post'
		})
	},
	// 确认收货
	confirmReceipt(params) {
		return http({
			url: url.confirmReceipt,
			data: params,
			method:'post'
		})
	},
	// 根据trade_no订单号获取订单详情
	getOrderByOrderNumber(params) {
		return http({
			url: url.getOrderByOrderNumber,
			data: params,
			method:'get'
		})
	},
	// 获取用户返余额数据
	getUserBalance(params) {
		return http({
			url: url.getUserBalance,
			data: params,
			method:'get'
		})
	},
	// 取消订单
	cancelOrder(params) {
		return http({
			url: url.cancelOrder,
			data: params,
			method:'post'
		})
	},
	// 获取推荐商品
	getRecommendList(params) {
		return http({
			url: url.getRecommendList,
			data: params,
			method:'get'
		})
	},
	// 微信支付
	wxPay(params) {
		return http({
			url: url.wxPay,
			data: params,
			method:'post'
		})
	},
	// 根据trade_no获取订单支付信息
	getTradeNoToPay(params) {
		return http({
			url: url.getTradeNoToPay,
			data: params,
			method:'post'
		})
	},
	// 根据购物车ID获取预订单信息
	placeOrder(params) {
		return http({
			url: url.placeOrder,
			data: params,
			method:'post'
		})
	},
	// 根据标签获取此店铺的商品数据
	getGoodsInStoreByMarks(params) {
		return http({
			url: url.getGoodsInStoreByMarks,
			data: params,
			method:'get'
		})
	},
	// 根据店铺ID获取店铺详情
	getStoreInfoByID(params) {
		return http({
			url: url.getStoreInfoByID,
			data: params,
			method:'get'
		})
	},
	// 申请提现
	applyExtractAmount(params) {
		return http({
			url: url.applyExtractAmount,
			data: params,
			method:'post'
		})
	},
	// 获取用户提现申请记录
	getExtractRecord(params) {
		return http({
			url: url.getExtractRecord,
			data: params,
			method:'get'
		})
	},
	// 获取用户订单列表
	getOrderList(params) {
		return http({
			url: url.getOrderList,
			data: params,
			method:'get'
		})
	},
	// 设置用户信息
	getCommentList(params) {
		return http({
			url: url.getCommentList,
			data: params,
			method:'get'
		})
	},
	// 获取收藏列表
	getCollectList(params) {
		return http({
			url: url.getCollectList,
			data: params,
			method:'get'
		})
	},
	// 短信验证码
	sendSmsCode(params) {
		return http({
			url: url.sendSmsCode,
			data: params,
			method:'post'
		})
	},
	// 添加或取消收藏
	setCollect(params) {
		return http({
			url: url.setCollect,
			data: params,
			method:'post'
		})
	},
	// 获取单条地址信息
	getSingleAddress(params) {
		return http({
			url: url.getSingleAddress,
			data: params,
			method:'get'
		})
	},
	// 根据购物车信息获取订单信息
	getOrderByCartId(params) {
		return http({
			url: url.getOrderByCartId,
			data: params,
			method:'post'
		})
	},
	// 删除购物车
	delCart(params) {
		return http({
			url: url.delCart,
			data: params,
			method:'post'
		})
	},
	// 设置购物车数量
	serCartNum(params) {
		return http({
			url: url.serCartNum,
			data: params,
			method:'post'
		})
	},
	// 删除历史浏览记录
	delBrowseHistory(params) {
		return http({
			url: url.delBrowseHistory,
			data: params,
			method:'post'
		})
	},
	// 获取浏览历史
	getBrowseHistory(params) {
		return http({
			url: url.getBrowseHistory,
			data: params,
			method:'get'
		})
	},
	// 设置用户信息
	getSearchData(params) {
		return http({
			url: url.getSearchData,
			data: params,
			method:'get'
		})
	},
	// 删除搜索历史纪录
	delSearchHistory(params) {
		return http({
			url: url.delSearchHistory,
			data: params,
			method:'post'
		})
	},
	// 获取搜索历史纪录
	getSearchHistory(params) {
		return http({
			url: url.getSearchHistory,
			data: params,
			method:'get'
		})
	},
	// 设置用户信息
	setUserInfo(params) {
		return http({
			url: url.setUserInfo,
			data: params,
			method:'post'
		})
	},
	// 获取我的资料信息
	getBaseUserInfo(params) {
		return http({
			url: url.getBaseUserInfo,
			data: params,
			method:'get'
		})
	},
	// 获取店铺商品
	getActGoodsInStore(params) {
		return http({
			url: url.getActGoodsInStore,
			data: params,
			method:'get'
		})
	},
	// 获取购物车数量
	getAllCartNumByToken(params) {
		return http({
			url: url.getAllCartNumByToken,
			data: params,
			method:'get'
		})
	},
	// 加入购物车
	addCart(params) {
		return http({
			url: url.addCart,
			data: params,
			method:'post'
		})
	},
	// 获取个人中心数据
	getCenterData(params) {
		return http({
			url: url.getCenterData,
			data: params,
			method:'get'
		})
	},
	// 删除地址
	delAddress(params) {
		return http({
			url: url.delAddress,
			data: params,
			method:'post'
		})
	},
	// 新建地址
	saveAddress(params) {
		return http({
			url: url.saveAddress,
			data: params,
			method:'post'
		})
	},
	// 获取购物车列表
	getCartList(params) {
		return http({
			url: url.getCartList,
			data: params,
			method:'get'
		})
	},
	// 登录
	login(params) {
		return http({
			url: url.login,
			data: params,
			method:'post'
		})
	},
	// 获取收货地址列表
	getAddressList(params) {
		return http({
			url: url.getAddressList,
			data: params,
			method:'get'
		})
	},
	// 获取商品信息
	getGoodDetailByCode(params) {
		return http({
			url: url.getGoodDetailByCode,
			data: params,
			method:'get'
		})
	},
	// 获取开通店铺的城市
	getOpenStoreRegion(params) {
		return http({
			url: url.getOpenStoreRegion,
			data: params,
			method:'get'
		})
	},
	// 获取分类页数据
	getGoodDataBySysCate(params) {
		return http({
			url: url.getGoodDataBySysCate,
			data: params,
			method:'get'
		})
	},
	// 获取首页数据
	getHomeData(params) {
		return http({
			url: url.getHomeData,
			data: params,
			method:'get'
		})
	},
	// 获取首页分类
	getSystemCate(params) {
		return http({
			url: url.getSystemCate,
			data: params,
			method:'get'
		})
	},
	// 获取首页轮播图
	getSystemBanner(params) {
		return http({
			url: url.getSystemBanner,
			data: params,
		})
	},
	// 获取位置
	getcityname(params) {
		return http({
			url: url.getRegionByLatAndLon,
			data: params,
			method:'get'
		})
	},
}